package com.chw.common.configs;

import com.chw.common.interceptors.KuaYu;
import com.chw.common.interceptors.LogInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
@Configuration
public class KuayuConfigInterceptor extends WebMvcConfigurationSupport {
    @Autowired
    private KuaYu kuaYu;
    @Autowired
    private LogInterceptor logInterceptor;
    @Override
    protected void addInterceptors(InterceptorRegistry registry) {
            /*注册跨域*/
        registry.addInterceptor(kuaYu).addPathPatterns("/**");
        /*认证拦截器*/
        registry.addInterceptor(logInterceptor).addPathPatterns("/**").excludePathPatterns("/com/**");
    }
}
